/**
 * @description 基础模型类
 * @author AI Assistant
 * @date 2023-10-27
 */

export class BaseModel {
  constructor(data = {}) {
    this.id = data.id || this.generateId()
    this.createTime = data.createTime || Date.now()
    this.updateTime = data.updateTime || Date.now()
  }

  generateId() {
    return Date.now().toString(36) + Math.random().toString(36).substr(2)
  }

  toJSON() {
    return {
      id: this.id,
      createTime: this.createTime,
      updateTime: this.updateTime
    }
  }
} 